package cn.bone.ou.data.controller;

import cn.bone.base.bean.CommonResult;
import cn.bone.ou.data.param.NoticeParam;
import cn.bone.ou.data.service.INoticeService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@RequestMapping("/ou/notice")
public class NoticeController {

    @Resource
    private INoticeService noticeService;

    @RequestMapping("/list")
    public CommonResult list(@Valid NoticeParam.ListParam param){
        return noticeService.list(param);
    }

    @RequestMapping("/add")
    public CommonResult add(@Valid NoticeParam.AddParam param){
        return noticeService.add(param);
    }

    @RequestMapping("/modify")
    public CommonResult modify(@Valid NoticeParam.ModifyParam param){
        return noticeService.modify(param);
    }

    @RequestMapping("/delete")
    public CommonResult delete(@Valid NoticeParam.DeleteParam param){
        return noticeService.delete(param);
    }

    @RequestMapping("/publish")
    public CommonResult publish(@Valid NoticeParam.PublishParam param){
        return noticeService.publish(param);
    }

    @RequestMapping("/unpublish")
    public CommonResult unpublish(@Valid NoticeParam.UnpublishParam param){
        return noticeService.unpublish(param);
    }

    @RequestMapping("/detail")
    public CommonResult detail(@Valid NoticeParam.DetailParam param){
        return noticeService.detail(param);
    }
}
